Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database #70

Merged
merged 1 commit into from
Nov 19, 2023
Merged

Database #70

merged 1 commit into from
Nov 19, 2023

Conversation

sorki
Copy link
Member

@sorki sorki commented Jul 27, 2020

PoC of database compatible with Nix ones at /nix/var/nix/db/db.sqlite (schema version 10).

Allows us to test roundtrips of content addressable addresses and store paths using systems db.

  • read only operations implemented
  • can't create indexes
  • ValidPath type is the same as the one in -core, glue conversion code is missing.

Test with

nix-shell
cabal run hnix-store-db

# In repl
> test
> bench

This runs queries vs your local database (owned by root so it's safe to play with this), for me currently results in

*** Exception: PersistMarshalError "*** Exception: ("string","fixed:sha512:2dc6n9ggmbjq8z6ahkcs3bk6yb4z7c56b19fyrnzw9a2ykpjsbllcvpc0cnb279h8s9pl42l6by709bsjg9g7v527k5j29zppamf73b")

because we don't have base64 yet.

cc @layus

@sorki
Copy link
Member Author

sorki commented Jul 27, 2020

Last two commits add base64 support and SHA512 seems to be handled correctly now.

@layus
Copy link
Contributor

layus commented Jul 27, 2020

Nice job :-) Will try to have a look at it in the near future

@domenkozar
Copy link
Contributor

https://github.com/cachix/cachix/blob/master/cachix/src/Cachix/Client/Store.hs#L42 how to properly call sqlite.db across the platforms.

@layus
Copy link
Contributor

layus commented Nov 16, 2023

That's a lot of fixups ! ;-).
Do you need me to test it ?

@sorki
Copy link
Member Author

sorki commented Nov 16, 2023

That's a lot of fixups ! ;-). Do you need me to test it ?

Ohai! Soon! It needs #231 (that's why it is so big) and couple more type annotations / transfomers :(( but it works well (at least on GHC947 hehe)

@sorki
Copy link
Member Author

sorki commented Nov 17, 2023

https://github.com/cachix/cachix/blob/master/cachix/src/Cachix/Client/Store.hs#L42 how to properly call sqlite.db across the platforms.

The link is dead but I've checked the history - all that's required is file: prefix? I've added that as it seems better to have it explicit.

@sorki sorki marked this pull request as ready for review November 17, 2023 12:12
@sorki
Copy link
Member Author

sorki commented Nov 17, 2023

That's a lot of fixups ! ;-). Do you need me to test it ?

Ok, yes! Should be good now.

@sorki sorki force-pushed the wip/db+pr64 branch 2 times, most recently from b28d9e3 to 13cffc1 Compare November 17, 2023 13:15
@sorki sorki merged commit 9118c30 into haskell-nix:master Nov 19, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants